package com.fowo.api.model.receivable;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fowo.api.common.validator.EnumsString;
import javax.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;

/** 应收单 导入导出辅助模型 */
@Getter
@Setter
public class ReceivableExcelPo {

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "单据编号")
  private String payCode;

  @NotNull(message = "客户不能为空")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*客户")
  private String customerSupplierName;

  @ExcelIgnore
  @ExcelProperty(value = "*客户")
  private Long customer;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "金额")
  private String totalAmount;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "数量")
  private String totalNum;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "结算组织")
  private String closeOrgName;

  @ExcelIgnore
  @ExcelProperty(value = "结算组织")
  private Long closeOrg;

  @NotNull(message = "业务日期不能为空")
  @DateTimeFormat("yyyy年MM月dd日HH:mm:ss")
  @ExcelProperty(value = "*业务日期")
  private java.util.Date businessDate;

  @Size(max = 500, message = "备注长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "备注")
  private String remark;

  @NotBlank(message = "产品类型不能为空")
  @EnumsString(
    value = { "原材料", "成品" },
    message = "产品类型的可用值为 “原材料”, “成品” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*产品类型")
  private String productType;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "状态")
  private String status;

  @EnumsString(
    value = { "未推送", "成功", "失败" },
    message = "推送状态的可用值为 “未推送”, “成功”, “失败” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "推送状态")
  private String pushStatus;

  @Size(max = 50, message = "推送信息长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "推送信息")
  private String resultInfo;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "制单人")
  private String preparedByName;

  @ExcelIgnore
  @ExcelProperty(value = "制单人")
  private Long preparedBy;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "审核人")
  private String verifierName;

  @ExcelIgnore
  @ExcelProperty(value = "审核人")
  private Long verifier;

  @Size(max = 50, message = "采购单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "采购单号")
  private String purchaseOrder;

  @Size(max = 50, message = "出库单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "出库单号")
  private String warehouseSn;
}
